export function transTime(value: number) {
    // console.log(value);
    let time = "";
    let h = Math.trunc(value / 1000 / 3600);
    // let h = value / 3600
    // value %= 3600;
    let m = Math.trunc(value / 1000 / 60);
    // let m = (value / 60);
    let s = Math.trunc(value / 1000 % 60);
    // let s = (value % 60);
    if (h > 0) {
        time = formatTime(h + ":" + m + ":" + s);
    } else {
        time = formatTime(m + ":" + s);
    }
    return time;
}

// 格式化时间
export function formatTime(value: any) {
    let time = "";
    let s = value.split(":");
    let i = 0;
    for (; i < s.length - 1; i++) {
        time += s[i].length == 1 ? "0" + s[i] : s[i];
        time += ":";
    }
    time += s[i].length == 1 ? "0" + s[i] : s[i];
    return time;
}

// 
export function transTimes(value: number) {
    // console.log(value);
    let time = "";
    let h = Math.trunc(value / 3600);
    // let h = value / 3600
    // value %= 3600;
    let m = Math.trunc(value / 60);
    // let m = (value / 60);
    let s = Math.trunc(value % 60);
    // let s = (value % 60);
    if (h > 0) {
        time = formatTime(h + ":" + m + ":" + s);
    } else {
        time = formatTime(m + ":" + s);
    }
    return time;
}
